<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
<link rel="stylesheet" href="__PUBLIC__/css/reset.css">
<link rel="stylesheet" href="__PUBLIC__/css/index.css">
<link rel="stylesheet" href="__PUBLIC__/css/art.css">
</head>
<body>
    <header>
        <h1><a href="{:U('home/index/index')}">My Blog</a></h1>
        <h4>所有的伟大，源于一个勇敢的开始.</h4>
    </header>
    <nav> 
        <ul>
            <foreach name="top" item="value">
            <li><a href="{:U('home/index/nav',array('cat_id'=>$value['cat_id'],'catname'=>$value['catname']))}">{$value['catname']}</a></li>
            </foreach>
        </ul>
    </nav>
    <div id="main">
        <div id="lside">
            <article>
                <h2><a href="#">{$data['title']}</a></h2>
                <div class="entry_header">
                    <time>{$data['pubtime']}</time>
                    &nbsp;by
                    <a href="#">Mr.z</a>&nbsp;&nbsp;
                    <a class="catlink" href="#">{$data['cat_id']}</a>
                </div>
                <div class="entry_content">
                  {$data['content']}
                </div>
            </article>
            <div id="comments">
                <foreach name="comment" item="value">
                <ol>
                    <li>
                        <img src={$value['pic']} alt="">
                        <cite><a href="#">{$value['nick']}</a></cite>&nbsp;&nbsp;&nbsp;&nbsp;Email&nbsp;:&nbsp;{$value['email']}<br>
                        <time>{$value['pubtime']}</time>
                    </li>
                    <li>
                        {$value['content']}
                    </li>
                </ol>
                </foreach>
            </div>
            <div id="respond" class="comment-respond">
                <h3>Comment</h3>
                <br><br>

                <form action="{:U('home/index/comment')}" method="post">

                <if condition="cookie_check() eq 1">
                    
                    <p><h3>UserName : {$Think.cookie.username}</h3></p>
                    <p><h3>Email : {$Think.cookie.email}</h3></p> 
                    <p>
                    <textarea name="content" cols="45" rows="8" aria-required="true"></textarea>
                    </p>
                    <p><input type="hidden" name="art_id" value="{$data['art_id']}">
                    </p>
                    <p><input type="hidden" name="email" value="{$Think.cookie.email}">
                    </p>  
                    <p><input type="hidden" name="nick" value="{$Think.cookie.nick}">
                    </p>                  
                    <p>
                    <input type="submit" value="Post Comment">
                    </p>

                <else />

                    <h3><a href="{:U('home/user/login')}">想评论,请登录。</a></h3><br><br><br><br>

                </if>

                </form>

            </div>
        </div>
        <div id="rside">
            
            <aside>
                <form action="">
                    <input type="text" name="search" placeholder="Search...">
                </form>
            </aside>

            <aside>
                <h4>最新文章</h4>
                <ul>
                <foreach name="hot" item="value">
                    <li><a href="{:U('home/index/art',array('art_id'=>$value['art_id']))}">{$value['title']}</a>&nbsp;&nbsp;({$value['comm']})</li>
                </foreach>
                </ul>
            </aside>

            <if condition="cookie_check() eq 1">
            <aside>
                <form action="">
                    <h4>只能评论哦~</h4>
                    <ul>
                    <li><a href="{:U('home/user/register')}">注册</a></li>
                    <br/>                    
                    <li><a href="{:U('home/user/logout')}">退出登录</a></li>
                    </ul>
                </form>
            </aside>            
            <else />
            <aside>
                <form action="">
                    <h4>只能评论哦~</h4>
                    <ul>
                    <li><a href="{:U('home/user/login')}">登录</a></li>
                    <br/>
                    <li><a href="{:U('home/user/register')}">注册</a></li>
                    </ul>
                </form>
            </aside>
            </if>
        </div>
    </div>
    <footer>
        Copyright &copy; 2015 · GeneratePress · WordPress
    </footer>
</body>
</html>